package com.czk.model.combile.prictice;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author:ChenZhangKun
 * @Date: 2020/7/29 22:37
 */
public class Son extends Person {
    List<Person> grandSons=new ArrayList<>();
    public Son(String name, int age) {
        super(name, age);
    }

    @Override
    protected void print() {
        for (Person grandSon : grandSons) {
            grandSon.print();
        }
    }

    @Override
    protected void add(Person person) {
        grandSons.add(person);
    }
}
